package org.example.controller;

import cn.jiyun.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.example.pojo.Technician;
import org.example.pojo.vo.LoginReqVo;
import org.example.pojo.vo.TechnicianVo;
import org.example.service.TechnicianService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("technician")
@Slf4j

public class TechnicianController {
    @Autowired
    private TechnicianService technicianService;


    @PostMapping("/findAll2")
    public List<Technician> findAll2(@RequestBody Technician technician) {
        return technicianService.findAll(technician);
    }

    @PostMapping("/selectStatus")
    public void selectStatus(@RequestBody Technician technician) {
        technicianService.selectStatus(technician);
    }

    @PostMapping("/selectPrice")
    public Result selectPrice(@RequestBody TechnicianVo technician) {
        List<Technician> technicians = technicianService.selectPrice(technician);
        return Result.ok(technicians);
    }

    @GetMapping("/selectXiao")
    public List<Technician> selectXiao() {
        List<Technician> technicians = technicianService.selectXiao();
        return technicians;
    }


    @GetMapping("/selectHao")
    public List<Technician> selectHao() {
        List<Technician> technicians = technicianService.selectHao();
        return technicians;
    }


}
